package com.football.feign.service;

import com.football.feign.entity.User;
import org.hxyjs.page.PageInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.*;

@FeignClient(name = "user",fallbackFactory = UserServiceFallbackFactory.class)
public interface UserFeignService {
    @GetMapping("/users")
    public String getAllUsers();
    @RequestMapping(value = "/user/{uno}")
    public String getUserByUno(String uno);

    @PatchMapping(value = "/user",headers = {"content-type=application/json"},consumes = MediaType.APPLICATION_JSON_VALUE
    ) //部分修改
    public String updateUser(@RequestBody User user);

    @RequestMapping("/users/pageInfo")
    public String getUsersByPage( @SpringQueryMap PageInfo pageInfo);
}
